package com.qf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.pojo.DtsGoods;
import com.qf.vo.DtsGoodsVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 商品基本信息表 Mapper 接口
 * </p>
 *
 * @author zhaojian
 * @since 2021-05-12
 */
public interface DtsGoodsMapper extends BaseMapper<DtsGoods> {

    @Select("select date_format(t.add_time,\"%Y-%m-%d\") as day,count(1) as products,\n" +
            "\t\t\t\tsum(price) as amount,count(DISTINCT order_id) as orders\n" +
            "from dts_order_goods t\n" +
            "group by date_format(t.add_time,\"%Y-%m-%d\")")
    List<DtsGoodsVo> selectGoodsList();
}
